Camelot:DeprecationError:PdfFileReader已被废弃 您所在的位置:网站首页 pdf file reader Camelot:DeprecationError:PdfFileReader已被废弃

Camelot:DeprecationError:PdfFileReader已被废弃

2023-04-08 10:37| 来源: 网络整理| 查看: 265

Camelot:DeprecationError:PdfFileReader已被废弃 回答 2 浏览 1.9万 2022-12-28

我一直在为我们的项目使用camelot,但从两天前开始我得到了以下错误信息。当试图运行以下代码片段时:

import camelot tables = camelot.read_pdf('C:\\Users\\user\\Downloads\\foo.pdf', pages='1')

我得到的是这个错误:

DeprecationError: PdfFileReader is deprecated and was removed in PyPDF2 3.0.0. Use PdfReader instead.

我检查了这个文件,它确实使用了pdfFileReader:c:\ProgramData\Anaconda3\lib\site-packages\camelot\handlers.py

我想我可以指定PyPDF2的版本,但它会在我安装camelot时自动安装(因为该库被camelot使用)。你认为有什么办法可以手动指定PyPDF2的版本吗?

Said Akyuz 提问于2022-12-28 在camelot的要求中,规定它需要PyPDF2>=1.26.0。因此,只要你安装一个满足该要求的版本,一切都应该是好的。关于这个问题的一个问题已经存在于他们的GitHub上。 - Clasherkasten 2022-12-28 你可以尝试手动安装该软件包:pip install pypdf #2楼 得票数 -1

我解决了这个问题卸载camelot-py,然后重新安装,包括"extra cv requirement",就像这样:

pip install "camelot-py[base]"

我希望它能成为有用的东西!

来源:https://readthedocs.org/projects/camelot-py/downloads/pdf/master/

pierofoust 提问于2023-03-17 你不需要Uninstaller。只需用--upgrade进行升级 - Martin Thoma 2023-03-18 已经有了一个答案。请看 这个 - Said Akyuz 2023-03-20


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有